package com.jvm.example.chapter0707;

/**
 * Created by 357070 on 2016/11/15.
 */
public class Test {
    static class DeadLoopClass {
        static {
            if (true) {
                System.out.println(Thread.currentThread() + "init DeadLoopClass");
            }
        }

        public static void main(String[] args) {
            Runnable script = new Runnable() {
                public void run() {
                    System.out.println(Thread.currentThread() + "start");
                    DeadLoopClass dlc = new DeadLoopClass();
                    System.out.println(Thread.currentThread() + " run over");
                }
            };

            Thread thread1 = new Thread(script);
            Thread thread2 = new Thread(script);
            thread1.start();
            thread2.start();
        }
    }
}

